fix(test/setupTestSandbox): wait until initial objects are propagated to informers#1878
Conversation
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: a7i The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/override pull-descheduler-verify-master |
There was a problem hiding this comment.
Pull request overview
This PR updates the kube client sandbox test setup to wait for initial objects to reach the sandbox’s fake informer indexers before tests proceed, reducing races in sandbox-related tests.
Changes:
- Adds polling in
setupTestSandboxto confirm initial objects are visible in the fake indexer. - Adds
metaimport for object metadata logging during propagation waits.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| exists, err := sandbox.hasRuntimeObjectInIndexer(obj) | ||
| if err != nil { | ||
| t.Logf("Error checking if object propagated to fake indexer: %v", err) | ||
| return false, nil |
| // Wait for initial objects to propagate from real client to fake client via event handlers. | ||
| for _, obj := range initialObjects { |
| // Wait for initial objects to propagate from real client to fake client via event handlers. | ||
| for _, obj := range initialObjects { | ||
| if err := wait.PollUntilContextTimeout(ctx, 10*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) { | ||
| exists, err := sandbox.hasRuntimeObjectInIndexer(obj) |
2673e34 to
66918dc
Compare
|
New changes are detected. LGTM label has been removed. |
|
/override pull-descheduler-verify-master |
|
@ingvagabund: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
…escheduler (0.35.1 ➔ 0.36.0) (#586) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/home-operations/charts-mirror/descheduler](https://github.com/kubernetes-sigs/descheduler) | minor | `0.35.1` → `0.36.0` | --- ### Release Notes <details> <summary>kubernetes-sigs/descheduler (ghcr.io/home-operations/charts-mirror/descheduler)</summary> ### [`v0.36.0`](https://github.com/kubernetes-sigs/descheduler/releases/tag/v0.36.0): Descheduler v0.36.0 [Compare Source](kubernetes-sigs/descheduler@v0.35.1...v0.36.0) #### What's Changed - fix(ci): pin helm-unittest plugin version and bump chart-testing-action by [@​a7i](https://github.com/a7i) in [#​1834](kubernetes-sigs/descheduler#1834) - Update helm RBAC to account for pvc failure on 0.35.0 by [@​cayla](https://github.com/cayla) in [#​1836](kubernetes-sigs/descheduler#1836) - Add init containers support to Helm chart by [@​kamleshjoshi8102](https://github.com/kamleshjoshi8102) in [#​1826](kubernetes-sigs/descheduler#1826) - Change icon URL in Chart.yaml by [@​a7i](https://github.com/a7i) in [#​1838](kubernetes-sigs/descheduler#1838) - fix: resolve detected data races by [@​ingvagabund](https://github.com/ingvagabund) in [#​1842](kubernetes-sigs/descheduler#1842) - fix(ci): upgrade codeql-action to v4 and clean up security workflow by [@​a7i](https://github.com/a7i) in [#​1847](kubernetes-sigs/descheduler#1847) - update golang semconv dependencies by [@​sammedsingalkar09](https://github.com/sammedsingalkar09) in [#​1848](kubernetes-sigs/descheduler#1848) - Extend PodLifeTime with condition, exit code, owner kind, and transition time filters by [@​a7i](https://github.com/a7i) in [#​1844](kubernetes-sigs/descheduler#1844) - security: Update trivy-action to use sha for v0.35.0 by [@​Priyankasaggu11929](https://github.com/Priyankasaggu11929) in [#​1854](kubernetes-sigs/descheduler#1854) - security: upgrade grpc and otel sdk dependencies by [@​sammedsingalkar09](https://github.com/sammedsingalkar09) in [#​1859](kubernetes-sigs/descheduler#1859) - evictions: fix missing observability for background evictions by [@​tiraboschi](https://github.com/tiraboschi) in [#​1856](kubernetes-sigs/descheduler#1856) - fix(descheduler): reset prometheus usage client at each extension point by [@​tiraboschi](https://github.com/tiraboschi) in [#​1862](kubernetes-sigs/descheduler#1862) - fix(.github/workflows/manifests.yaml): pin actions to a sha by [@​ingvagabund](https://github.com/ingvagabund) in [#​1868](kubernetes-sigs/descheduler#1868) - cloudbuild: pin gcb-docker-gcloud image by digest by [@​Paramesh324](https://github.com/Paramesh324) in [#​1871](kubernetes-sigs/descheduler#1871) - chart: allow overriding ServiceMonitor apiVersion by [@​a7i](https://github.com/a7i) in [#​1837](kubernetes-sigs/descheduler#1837) - ci: pin GitHub Actions to immutable SHAs by [@​a7i](https://github.com/a7i) in [#​1875](kubernetes-sigs/descheduler#1875) - evictions: fix assumePod silently dropping success metric on informer race by [@​tiraboschi](https://github.com/tiraboschi) in [#​1873](kubernetes-sigs/descheduler#1873) - chore(defaultevictor): add MatchExpressions compatibility to the namespaceselector by [@​Fankhauserli](https://github.com/Fankhauserli) in [#​1853](kubernetes-sigs/descheduler#1853) - fix(test/setupTestSandbox): wait until initial objects are propagated to informers by [@​ingvagabund](https://github.com/ingvagabund) in [#​1878](kubernetes-sigs/descheduler#1878) - \[v0.36.0] release prep: bump k8s/go deps, manifests, docs, and CI matrix by [@​a7i](https://github.com/a7i) in [#​1874](kubernetes-sigs/descheduler#1874) #### New Contributors - [@​kamleshjoshi8102](https://github.com/kamleshjoshi8102) made their first contribution in [#​1826](kubernetes-sigs/descheduler#1826) - [@​Priyankasaggu11929](https://github.com/Priyankasaggu11929) made their first contribution in [#​1854](kubernetes-sigs/descheduler#1854) - [@​Paramesh324](https://github.com/Paramesh324) made their first contribution in [#​1871](kubernetes-sigs/descheduler#1871) - [@​Fankhauserli](https://github.com/Fankhauserli) made their first contribution in [#​1853](kubernetes-sigs/descheduler#1853) **Full Changelog**: <kubernetes-sigs/descheduler@v0.35.0...v0.36.0> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL21pbm9yIl19--> Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/586
…uler ( 0.35.1 ➔ 0.36.0 ) (#85) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/home-operations/charts-mirror/descheduler](https://github.com/kubernetes-sigs/descheduler) | minor | `0.35.1` → `0.36.0` | --- >⚠️ **Warning** > > Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/34) for more information. --- ### Release Notes <details> <summary>kubernetes-sigs/descheduler (ghcr.io/home-operations/charts-mirror/descheduler)</summary> ### [`v0.36.0`](https://github.com/kubernetes-sigs/descheduler/releases/tag/v0.36.0): Descheduler v0.36.0 [Compare Source](kubernetes-sigs/descheduler@v0.35.1...v0.36.0) #### What's Changed - fix(ci): pin helm-unittest plugin version and bump chart-testing-action by [@​a7i](https://github.com/a7i) in [#​1834](kubernetes-sigs/descheduler#1834) - Update helm RBAC to account for pvc failure on 0.35.0 by [@​cayla](https://github.com/cayla) in [#​1836](kubernetes-sigs/descheduler#1836) - Add init containers support to Helm chart by [@​kamleshjoshi8102](https://github.com/kamleshjoshi8102) in [#​1826](kubernetes-sigs/descheduler#1826) - Change icon URL in Chart.yaml by [@​a7i](https://github.com/a7i) in [#​1838](kubernetes-sigs/descheduler#1838) - fix: resolve detected data races by [@​ingvagabund](https://github.com/ingvagabund) in [#​1842](kubernetes-sigs/descheduler#1842) - fix(ci): upgrade codeql-action to v4 and clean up security workflow by [@​a7i](https://github.com/a7i) in [#​1847](kubernetes-sigs/descheduler#1847) - update golang semconv dependencies by [@​sammedsingalkar09](https://github.com/sammedsingalkar09) in [#​1848](kubernetes-sigs/descheduler#1848) - Extend PodLifeTime with condition, exit code, owner kind, and transition time filters by [@​a7i](https://github.com/a7i) in [#​1844](kubernetes-sigs/descheduler#1844) - security: Update trivy-action to use sha for v0.35.0 by [@​Priyankasaggu11929](https://github.com/Priyankasaggu11929) in [#​1854](kubernetes-sigs/descheduler#1854) - security: upgrade grpc and otel sdk dependencies by [@​sammedsingalkar09](https://github.com/sammedsingalkar09) in [#​1859](kubernetes-sigs/descheduler#1859) - evictions: fix missing observability for background evictions by [@​tiraboschi](https://github.com/tiraboschi) in [#​1856](kubernetes-sigs/descheduler#1856) - fix(descheduler): reset prometheus usage client at each extension point by [@​tiraboschi](https://github.com/tiraboschi) in [#​1862](kubernetes-sigs/descheduler#1862) - fix(.github/workflows/manifests.yaml): pin actions to a sha by [@​ingvagabund](https://github.com/ingvagabund) in [#​1868](kubernetes-sigs/descheduler#1868) - cloudbuild: pin gcb-docker-gcloud image by digest by [@​Paramesh324](https://github.com/Paramesh324) in [#​1871](kubernetes-sigs/descheduler#1871) - chart: allow overriding ServiceMonitor apiVersion by [@​a7i](https://github.com/a7i) in [#​1837](kubernetes-sigs/descheduler#1837) - ci: pin GitHub Actions to immutable SHAs by [@​a7i](https://github.com/a7i) in [#​1875](kubernetes-sigs/descheduler#1875) - evictions: fix assumePod silently dropping success metric on informer race by [@​tiraboschi](https://github.com/tiraboschi) in [#​1873](kubernetes-sigs/descheduler#1873) - chore(defaultevictor): add MatchExpressions compatibility to the namespaceselector by [@​Fankhauserli](https://github.com/Fankhauserli) in [#​1853](kubernetes-sigs/descheduler#1853) - fix(test/setupTestSandbox): wait until initial objects are propagated to informers by [@​ingvagabund](https://github.com/ingvagabund) in [#​1878](kubernetes-sigs/descheduler#1878) - \[v0.36.0] release prep: bump k8s/go deps, manifests, docs, and CI matrix by [@​a7i](https://github.com/a7i) in [#​1874](kubernetes-sigs/descheduler#1874) #### New Contributors - [@​kamleshjoshi8102](https://github.com/kamleshjoshi8102) made their first contribution in [#​1826](kubernetes-sigs/descheduler#1826) - [@​Priyankasaggu11929](https://github.com/Priyankasaggu11929) made their first contribution in [#​1854](kubernetes-sigs/descheduler#1854) - [@​Paramesh324](https://github.com/Paramesh324) made their first contribution in [#​1871](kubernetes-sigs/descheduler#1871) - [@​Fankhauserli](https://github.com/Fankhauserli) made their first contribution in [#​1853](kubernetes-sigs/descheduler#1853) **Full Changelog**: <kubernetes-sigs/descheduler@v0.35.0...v0.36.0> </details> --- ### Configuration 📅 **Schedule**: (in timezone America/New_York) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xODIuMiIsInVwZGF0ZWRJblZlciI6IjQzLjE4Mi4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL21pbm9yIl19--> Reviewed-on: https://git.greyrock.io/greyrock-labs/home-ops/pulls/85
Description
ssia
Checklist
Please ensure your pull request meets the following criteria before submitting
for review, these items will be used by reviewers to assess the quality and
completeness of your changes: